﻿

<CnGalWebSite.Components.Containers.MasaTitleContainer Icon="@IconType.Home.ToIconString()" Title="主要信息" Class="@Class" Collapable>
    <MRow>
        <MCol Cols="12" Md="6" Lg="3">
            <CnGalWebSite.Components.Images.UploadButton ShowCropper @bind-ImagePath="@Model.MainPicture" Type="ImageAspectType._16_9" Text="上传主图" Class="mb-4" />
         </MCol>
          <MCol Cols="12" Md="6" Lg="3">
             <CnGalWebSite.Components.Images.UploadButton ShowCropper @bind-ImagePath="@Model.Thumbnail" Type="ImageAspectType._1_1" Text="上传缩略图" Class="mb-4" />
         </MCol>
          <MCol Cols="12" Md="6" Lg="3">
             <CnGalWebSite.Components.Images.UploadButton @bind-ImagePath="@Model.BackgroundPicture" Type="ImageAspectType.None" Text="上传大背景图" Class="mb-4" />
         </MCol>
         <MCol Cols="12" Md="6" Lg="3">
             <CnGalWebSite.Components.Images.UploadButton @bind-ImagePath="@Model.SmallBackgroundPicture" Type="ImageAspectType.None" Text="上传小背景图" Class="mb-4" />
         </MCol>
         <MCol Cols="12">
          </MCol>
          <MCol Cols="12" Md="6">
             <CnGalWebSite.Components.Inputs.MasaSelecte @bind-Value="Model.Type" TValue="VoteType" Label="类型" />
         </MCol>
          <CnGalWebSite.Shared.MasaComponent.Shared.Editors.Cards.DisplayNameCard @bind-Name="Model.Name" @bind-DisplayName="Model.DisplayName" Class="form-group col-12 col-sm-6" />

          <MCol Cols="12">
              <MTextarea Rows="3" @bind-Value="Model.BriefIntroduction" Label="简介" />
          </MCol>
         <MCol Cols="12" Md="6">
             <CnGalWebSite.Components.Inputs.MasaDatePicker @bind-Value="Model.BeginTime" ShowDate ShowTime Nullable="false" Label="开始时间" />
         </MCol>
         <MCol Cols="12" Md="6">
             <CnGalWebSite.Components.Inputs.MasaDatePicker @bind-Value="Model.EndTime" ShowDate ShowTime Nullable="false" Label="结束时间" />
         </MCol>
         @if (Model.Type == VoteType.MultipleChoice)
        {
            <MCol Cols="12" Md="6">
                <MTextField @bind-Value="Model.MinimumSelectionCount" Label="同时选中项下限" />
            </MCol>
            <MCol Cols="12" Md="6">
                <MTextField @bind-Value="Model.MaximumSelectionCount" Label="同时选中项上限" />
            </MCol>
        }
        <MCol Cols="12" Md="6">
            <MCheckbox @bind-Value="Model.IsAllowModification" Label="允许用户重新投票" TValue="bool" />
        </MCol>

    </MRow>
  </CnGalWebSite.Components.Containers.MasaTitleContainer>

 @code {
    [Parameter]
    public EditVoteModel Model { get; set; }
    [Parameter]
    public string Class { get; set; }
}
